package top.healthylife.gateway.platform.fh.dto.shesu.businessquery.req;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors;
import top.healthylife.basics.utils.exception.BusinessException;
import top.healthylife.gateway.platform.fh.dto.sheshui.businessquery.req.FhReqBusinessQuerySheShuiGJBDto;
import top.healthylife.gateway.platform.fh.dto.shesu.businessquery.res.FhResBusinessQuerySSGJBDto;
import top.healthylife.gateway.platform.fh.dto.unify.req.FhReqBusinessQueryUnifyDto;

import java.util.Arrays;

/**
 * @author : GaoZeXi
 * @date 2021/11/1 11:52
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@ApiModel("涉诉高精版-企业查询")
public class FhReqBusinessQuerySSGJBDto extends FhReqBusinessQueryUnifyDto {


    @Override
    public void checkDataType(String dataType) {
        if(ObjectUtil.isNotEmpty(dataType)){
            Arrays.stream(FhReqBusinessQuerySheShuiGJBDto.DataType.values()).filter(e -> e.toString().equals(dataType))
                    .findAny().orElseThrow(() -> new BusinessException("[企业查询-涉诉高精版]入参的dataType不在期望值,期望的类型列表为:"+ Arrays.toString(DataType.values())));
        }
    }

    @ApiModel("企业查询-涉诉高精版 数据类型")
    @Getter
    public enum DataType {
        /**
         * 具体意思查看 {@link FhResBusinessQuerySSGJBDto}
         */
        cpws,
        ktgg,
        zxgg,
        shixin,
        fygg,
        ajlc,
        bgt,
        sifacdk,
        pmgg,
    }
}
